<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>

	<%
	int pageCount=1;
	int sessionCount=1;
	int applicationCount=1;
	//页面域
	if(pageContext.getAttribute("pageCount")!=null){
		pageCount=Integer.parseInt(pageContext.getAttribute("pageCount").toString());
		pageCount++;
	}
	pageContext.setAttribute("pageCount",pageCount);

	if(session.getAttribute("sessionCount")!=null){
		sessionCount=Integer.parseInt(session.getAttribute("sessionCount").toString());
		sessionCount++;
	}
	session.setAttribute("sessionCount",sessionCount);
	
	if(application.getAttribute("applicationCount")!=null){
		applicationCount=Integer.parseInt(application.getAttribute("applicationCount").toString());
		applicationCount++;
	}
	application.setAttribute("applicationCount",applicationCount);
	%>


	<p>
		页面域计数器<%=pageCount %>
	</p>
	<p>
		session域计数器<%=sessionCount %>
	</p>
	<p>
		页面域计数器<%=applicationCount %>
	</p>

</body>
</html>